The present invention is related generally to the field of computer graphics, and more particularly, to compressing graphics data, such as texture data, in a computer graphics processing system.
Computer graphics images displayed on a computer display are formed by a composite of individual colored pixels. The pixels are arranged in a large array having rows and columns, where each pixel in the array has a uniform color value. The pixels can be represented in various color spaces. It is often the case where color spaces can be separated into three separate components. The color of the pixel is determined by the combination of the three components of the color space in which the pixel""s color is represented. Each of the components of the color space has a value represented by a binary value which indicates the relative intensity of the respective component. Typically, each component of a color space is represented by an 8-bit value so that there can be up to 256 different values for each of the components. As a result, it generally takes 24-bits to represent a pixel.
An example of a common color space in which the color of a pixel is represented is a red-green-blue (RGB) color space. Each pixel has red, green, and blue components, which, when combined, produce a color. The RGB color space is commonly used for pixels about to be displayed on a computer display. Another color space commonly used to represent the color of a pixel is the YUV color space. The YUV color space consists of three components, one luma component (Y), and two chroma components (UV). The luma value represents the black-and-white information of the pixel color, while the chroma components represent color information for the pixels. A specific version of the YUV color space is the YCbCr color space. The two chroma components are a blue chroma component (Cb) and a red chroma component (Cr).
Graphics processing system performance can be directly affected by the length of the pixel data. Generally, the more bits it takes to represent each pixel, the less efficient the graphics processing system becomes. For example, more memory is required to store longer pixel data, it takes more time to move longer pixel data from memory to a processor and back again, and color calculations based on pixel data are more complicated and time consuming. As the demand for faster graphics systems has increased, Methods for reducing the number of bits used to represent a pixel have been developed.
Present graphics processing systems use methods of data compression to reduce the number of bits required to represent a pixel. Some of these methods store pixel data in the YCbCr color space, and share the components of one pixel with another, or several other, adjacent pixels so that on the average, less information is stored for each pixel. The human eye is more sensitive to changes in the luma (Y) component than to changes in the chroma (CbCr) components. As a result, the Cb and Cr components are typically shared by multiple pixels, where each pixel has its own Y components. Although each component is represented by 8-bits, the compression of the pixel data occurs because the 16-bits representing the Cb and Cr components are shared by multiple pixels. Thus, where two pixels share the Cb and Cr components of one pixel, each pixel is represented by only 16-bits, on the average. That is,
[(16 bits, two Y components)+(8 bits, Cb component)+(8 bits, Cr component)]÷2 pixels=16-bits per pixel.
This format, commonly referred to as a 4:2:2 YCbCr format, results in a 3:2 compression over the 24-bits per pixel mentioned previously.
Greater data compression may be achieved by sharing the Cb and Cr components among more pixels, each of which have their own Y component. For example, where four pixels share the chroma components of one pixel, each pixel is represented, on the average, by only 12-bits, thus yielding a 2:1 compression ratio. That is, 48-bits are required to represent four pixels. This format is commonly referred to as a 4:1:1 YCbCr format.
A compression method similar to the 4:1:1 YCbCr format is illustrated in FIG. 1. Four pixels arranged in a two-by-two matrix 10 share two common Cb and Cr components, 12 and 14, respectively. Each of the four pixels in the matrix 10 has a luma component, represented in FIG. 1 by Y00, Y01, Y10, and Y11, respectively. The luma components Y00, Y01, Y10, and Y11 are combined with a corresponding blue chroma component 12, Cb00, and a corresponding red chroma component 14, Cr00, into a 48-bit data structure 16. This compression method is commonly referred to as a 4:2:0 YCbCr format, and has a resulting compression ratio of 2:1. As illustrated in FIG. 2, each of the Y components 10a-d, and each chroma component, 12 and 14, are represented by 8-bits, thus yielding a 48-bit data structure 16 for the four pixels of the matrix 10.
Although the 4:1:1 and 4:2:0 YCbCr formats provide a 2:1 compression ratio, the 48-bit length does not facilitate efficient memory address generation. That is, where the graphics data is tiled in memory, the address sequence for the graphics data, 0, 48, 96, . . . 48n, is not one that can be easily formulated using a binary base. Consequently, valuable processing resources that may be used to enhance graphics performance are wasted on generating memory addresses. Therefore, there is a need for an apparatus and compression technique that compresses graphics data into a data structure that, among other things, facilitates memory address generations
An apparatus and method for compressing graphics data representing color values of pixels. Each pixel has a color value that results from the combination of a luma component and chroma components. The number of bits representing the luma and chroma components of a pixel are reduced to less than eight bits, and the luma components of at least four pixels and at least two chroma components are combined into a data structure r bits in length. The number of bits of the data structure is derived from r=2s, where s is an integer greater than or equal to five.
In an aspect of the invention, s=5, resulting in a data structure 32-bits in length. In another aspect of the invention, the data structure consists of the luma components for four pixels and two chroma components. The components may be arranged such that the chroma components are preceded, and followed by the luma components of two pixels. In another aspect of the invention, the luma components are 5-bits in length, and the chroma components are 6-bits in length.